package com.augurit.gzcgwsp.webservice;

import java.net.MalformedURLException;

import org.codehaus.xfire.XFire;
import org.codehaus.xfire.XFireFactory;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.binding.ObjectServiceFactory;

import com.augurit.gzcgwsp.webservice.service.IKingdomDataService;

public class WebServiceTest {

	/**
	 * @param args
	 * @throws Exception
	 * @throws MalformedURLException
	 */
	public static void main(String[] args) throws MalformedURLException,Exception {
		String url = "http://172.16.9.63:8080/gzcgwsp/services/IKingdomDataService";
		Service service = (Service) new ObjectServiceFactory()
				.create(IKingdomDataService.class);
		XFire xFire = XFireFactory.newInstance().getXFire();
		XFireProxyFactory factory = new XFireProxyFactory(xFire);
		try {
			IKingdomDataService dataservice = (IKingdomDataService) factory.create(service, url);
			//取燃气经营许可的数据
			String result = dataservice.getRqjyxkDatas("1","1");//传入的参数为当前页和每页显示的条数。
			
			//System.out.println(result);
			//取户外广告的数据
			//String results = dataservice.getHwggDatas("1","1");//传入的参数为当前页和每页显示的条数。
			System.out.println(result);
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}
	}
}
